import { defineStore } from "pinia";

export const useAllStore = defineStore("allstore", {
  state: (): IStbO => ({
    user: { userName: "", avatar: "" },
    collapse: false,
    token: "",
    menu: [],
    account: { userName: "", password: "" },
    tagsList: []
  }),
  actions: {
    handleCollapse(e: boolean) {
      this.collapse = e;
    }
  },
  persist: [
    { paths: ["token", "user", "menu", "account"], storage: localStorage },
    { paths: ["collapse"], storage: sessionStorage }
  ]
});
